<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head layout:fragment="contentHead" th:insert="commonHead :: common_head(~{::title})">
</head>
<body>
<th:block th:insert="commonCss :: common_css"></th:block>
<th:block layout:fragment="contentCss"></th:block>
<div th:include="navbar :: navbar"></div>
<div id="page-wrapper" layout:fragment="content">
</div>
</body>

<th:block th:insert="commonJs :: common_js">
</th:block>
<th:block layout:fragment="contentJs">
</th:block>

<script type="text/javascript" th:inline="javascript">
    $(function () {
        $(document).ajaxComplete(function( event, xhr, settings ) {
            if(xhr.status != 200) {
                if(xhr.responseJSON != null) {
                    for(var i=0;i<xhr.responseJSON.errorMsg.length;i++){
                        toastr.error(xhr.responseJSON.errorMsg[i]);
                    }
                } else {
                    try {
                        var errors = JSON.parse(xhr.responseText);
                        for(var i=0;i<errors.errorMsg.length;i++){
                            toastr.error(errors.errorMsg[i]);
                        }
                    }catch (e) {
                        toastr.error("服务器内部错误，请稍后在试");
                    }
                }
            }
        });
    })
</script>
</html>